package com.woniuxy.woniuticket.moviemodule.pojo;

import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.util.Date;

/**
 * 热点消息 pojo
 */
public class ScheduleMsg {
    private Integer id;
    private Integer moviesId;
    private Integer hallId;
    private String hallname;
    private Integer duration;
    private String scheduleprice;
    private String movename;
    private String mainactor;
    private String director;
    private String description;
    private String img;
    private String vediosrc;
    private String movieprice;
    private Date endtime;
    private Date begintime;
    private long moveisMin;
    private String endTimeHM;
    private String startTimeHM;
    private String movieMonth;
    private String movieYMD;


    public String getMovieYMD() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String startTime = simpleDateFormat.format(getBegintime());
        this.movieYMD = startTime;
        return movieYMD;
    }

    public void setMovieYMD(String movieYMD) {
        this.movieYMD = movieYMD;
    }

    public String getEndTimeHM() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
        String endTime = simpleDateFormat.format(getEndtime());
        this.endTimeHM = endTime;
        return endTimeHM;
    }

    public String getStartTimeHM() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
        String startTime = simpleDateFormat.format(getBegintime());
        this.startTimeHM = startTime;
        return startTimeHM;
    }

    public void setStartTimeHM(String startTimeHM) {
        this.startTimeHM = startTimeHM;
    }

    public String getMovieMonth() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd");
        String movieM = simpleDateFormat.format(getEndtime());
        this.movieMonth = movieM;
        return movieMonth;
    }

    public void setMovieMonth(String movieMonth) {
        this.movieMonth = movieMonth;
    }

    public long getMoveisMin() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long between = 0;
        String endTime = simpleDateFormat.format(getEndtime());
        String startTime = simpleDateFormat.format(getBegintime());
        try {
            Date end = simpleDateFormat.parse(endTime);
            Date start = simpleDateFormat.parse(startTime);
            between = (end.getTime()-start.getTime());
        }catch (Exception e){
            e.printStackTrace();
        }
        long day = between / (24 * 60 * 60 * 1000);
        long moveMin = ((between / (60 * 1000)) - day * 24 * 60);
        this.moveisMin = moveMin;
        return moveisMin;
    }

    public void setMoveisMin(long moveisMin) {
        this.moveisMin = moveisMin;
    }

    public void setEndTimeHM(String endTimeHM) {
        this.endTimeHM = endTimeHM;
    }

    public String getHallname() {
        return hallname;
    }

    public void setHallname(String hallname) {
        this.hallname = hallname;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getMoviesId() {
        return moviesId;
    }

    public void setMoviesId(Integer moviesId) {
        this.moviesId = moviesId;
    }

    public Integer getHallId() {
        return hallId;
    }

    public void setHallId(Integer hallId) {
        this.hallId = hallId;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public String getScheduleprice() {
        return scheduleprice;
    }

    public void setScheduleprice(String scheduleprice) {
        this.scheduleprice = scheduleprice;
    }

    public String getMovename() {
        return movename;
    }

    public void setMovename(String movename) {
        this.movename = movename;
    }

    public String getMainactor() {
        return mainactor;
    }

    public void setMainactor(String mainactor) {
        this.mainactor = mainactor;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getVediosrc() {
        return vediosrc;
    }

    public void setVediosrc(String vediosrc) {
        this.vediosrc = vediosrc;
    }

    public String getMovieprice() {
        return movieprice;
    }

    public void setMovieprice(String movieprice) {
        this.movieprice = movieprice;
    }

    public Date getEndtime() {
        return endtime;
    }

    public void setEndtime(Date endtime) {
        this.endtime = endtime;
    }

    public Date getBegintime() {
        return begintime;
    }

    public void setBegintime(Date begintime) {
        this.begintime = begintime;
    }

    @Override
    public String toString() {
        return "ScheduleMsg{" +
                "id=" + id +
                ", moviesId=" + moviesId +
                ", hallId=" + hallId +
                ", hallname='" + hallname + '\'' +
                ", duration=" + duration +
                ", scheduleprice='" + scheduleprice + '\'' +
                ", movename='" + movename + '\'' +
                ", mainactor='" + mainactor + '\'' +
                ", director='" + director + '\'' +
                ", description='" + description + '\'' +
                ", img='" + img + '\'' +
                ", vediosrc='" + vediosrc + '\'' +
                ", movieprice='" + movieprice + '\'' +
                ", endtime=" + endtime +
                ", begintime=" + begintime +
                ", moveisMin=" + moveisMin +
                ", endTimeHM='" + endTimeHM + '\'' +
                ", startTimeHM='" + startTimeHM + '\'' +
                ", movieMonth='" + movieMonth + '\'' +
                ", movieYMD='" + movieYMD + '\'' +
                '}';
    }
}
